package com.命令模式.案例1;

import lombok.Data;

@Data
public class LightOffComment implements Comment{

    LightReceiver lightReceiver;

    public LightOffComment(LightReceiver lightReceiver) {
        this.lightReceiver = lightReceiver;
    }

    @Override
    public void execute() {
        lightReceiver.off();
    }

    @Override
    public void undo() {
        lightReceiver.on();
    }
}
